/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package skat.comparators;

import rlpw.lang.Factory;
import rlpw.lang.Factory.FactoryEntry;
import skat.Card;
import skat.games.Game;

/**
 *
 * @author Ronny
 */
@FactoryEntry({Factory.DEFAULT, Game.GRAND, Game.ACORN })
public class ComparatorDefault extends Comparator {

    public int getSortIndex(Card k) {
        if (k.rank() < 3) {
            return 7 * k.suit() + k.rank();
        } else if (k.rank() > 3) {
            return 7 * k.suit() + (k.rank() - 1);
        } else {
            return 28 + k.suit();
        }
    }
}
